From 650c9d1e12eae89d959c76849f066496b39e6267 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Robert=20Stojni=C4=87?= Date: Thu, 14 Dec 2006 01:06:28 +0000 Subject: [PATCH] Small patch to minimize the number of category variants need to be fetched. --- includes/Parser.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/Parser.php b/includes/Parser.php index e01b0f815b..7e594f1bbe 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -4083,10 +4083,12 @@ class Parser foreach( $categories as $category){ $variants = $wgContLang->convertLinkToAllVariants($category); foreach($variants as $variant){ - $variantTitle = Title::newFromDBkey( Title::makeName(NS_CATEGORY,$variant) ); - if(is_null($variantTitle)) continue; - $linkBatch->addObj( $variantTitle ); - $categoryMap[$variant] = $category; + if($variant != $category){ + $variantTitle = Title::newFromDBkey( Title::makeName(NS_CATEGORY,$variant) ); + if(is_null($variantTitle)) continue; + $linkBatch->addObj( $variantTitle ); + $categoryMap[$variant] = $category; + } } } -- 2.20.1